#pragma once
#include "base/YUVImage.h"
#include <memory>
#include <string>
namespace Sivin {
  class YUVReader {
  public:
    int open(std::string path, int width, int height, YUVImage::Format format);
    int readFrame(std::unique_ptr<YUVImage> &image);
    void colse();
  private:
    std::unique_ptr<std::ifstream> mYuvStream{nullptr};
    int mWidth{0};
    int mHeight{0};
    YUVImage::Format mFmt{YUVImage::Format::YUV420};
  };
}// namespace Sivin